<?php

class Db_Tables_Level1 extends Zend_Db_Table
{
    protected $_name = 'level1';
	var $level1_id;
	
	function GetChannelId()
	{
		$result = 0;
		
		if($this->level1_id)
		{
			$row = $this->fetchRow("id='".$this->level1_id."'");
			
			if($row)
			{
				$result = $row->channel_id;
			}
		}
		
		return $result;
	}
	
	function LoadChannelIdToSession($id)
	{
		if(!$_SESSION['site_info'])
		{
			$_SESSION['site_info'] = array();
		}
		
		$_SESSION['site_info']['channel_id'] = $id;
	}
}